package com.junzhiit.nengji.shop.model.enums;

import com.bainaeco.framework.exception.InvalidArgumentException;

public enum ShopType {
	
	ENTERPRISE(0,"企业"),
	SOHO(1,"个体户"),
	PERSONAL(2,"个人");
	
	private Integer status;
	
	private String value;

	private ShopType(Integer status,String value){
		this.status = status;
		this.value = value;
	}

	public int toIntStatus() {
		return this.status;
	}
	
	public String toStringValue() {
		return this.value;
	}

	public static ShopType toFlag(int status) {
		if (ENTERPRISE.status == status) {
			return ENTERPRISE;
		} else if (SOHO.status == status) {
			return SOHO;
		}else if(PERSONAL.status == status){
			return PERSONAL;
		}else {
			throw new InvalidArgumentException("Unknown ShopType[" + status + "].");
		}
	}
}
